/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙，一起邂逅框架梦]
 * 
 * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_account.htm
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.zhiqim.account.dbo.user;

import java.io.Serializable;

import org.zhiqim.kernel.annotation.AnAlias;
import org.zhiqim.kernel.annotation.AnNew;
import org.zhiqim.kernel.json.Jsons;
import org.zhiqim.orm.annotation.*;

/**
 * 用户账号表 对应表《USER_ACCOUNT》
 */
@AnAlias("UserAccount")
@AnNew
@AnTable(table="USER_ACCOUNT", key="USER_ACCOUNT", type="InnoDB")
@AnIndex({@AnIndexValue(name="IX_USER_ACCOUNT_ID", column="USER_ID", unique=false)})
public class UserAccount implements Serializable
{
    private static final long serialVersionUID = 1L;

    @AnTableField(column="USER_ID", type="long", notNull=true)    private long userId;    //1.用户编号
    @AnTableField(column="USER_ACCOUNT", type="string,32", notNull=true)    private String userAccount;    //2.用户账号，手机号、邮箱、QQ微信的OPEN_ID
    @AnTableField(column="ACCOUNT_TYPE", type="short", notNull=true)    private int accountType;    //3.用户类型：90--用户名，100--手机，110--邮箱,  200--QQ，210--微信开放平台，220--微信公众号
    @AnTableField(column="ACCOUNT_UNION", type="string,32", notNull=false)    private String accountUnion;    //4.用户联合值，如微信或QQ登陆时unionid

    public String toString()
    {
        return Jsons.toString(this);
    }

    public long getUserId()
    {
        return userId;
    }

    public void setUserId(long userId)
    {
        this.userId = userId;
    }

    public String getUserAccount()
    {
        return userAccount;
    }

    public void setUserAccount(String userAccount)
    {
        this.userAccount = userAccount;
    }

    public int getAccountType()
    {
        return accountType;
    }

    public void setAccountType(int accountType)
    {
        this.accountType = accountType;
    }

    public String getAccountUnion()
    {
        return accountUnion;
    }

    public void setAccountUnion(String accountUnion)
    {
        this.accountUnion = accountUnion;
    }

}
